package com.ui.service.Impl;

import com.ui.service.AttributeService;
import com.wanmei.exception.WanmeiException;
import com.wanmei.mapper.AttributeMapper;
import com.wanmei.mapper.ProductMapper;
import com.wanmei.pojo.Attribute;
import com.wanmei.pojo.Exception_Msg;
import com.wanmei.pojo.Product;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


@Service
public class AttributeServiceImpl implements AttributeService{
    @Autowired
    private AttributeMapper attributeMapper;
    @Autowired
    private ProductMapper productMapper;
    @Override
    public Attribute getAttributeAllByCid(int pid) {
        Product product = productMapper.selectByPrimaryKey(pid);

        Attribute attribute = attributeMapper.getAttributeAllByCid(product.getCid());
        return attribute;
    }
}
